<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<script type="text/javascript">
<!--
$(function(){
	loadShopInfo();
});

function loadShopCart(){
	if($("div.cart_drop").css("display") == "none"){
		loadShopInfo();
	}else{
		return;
	}
}

function loadShopInfo(){
    $.ajax({
 		url : "<c:url value="/crtc/getShopCat"/>",
 		type : "post",
 		dataType:"json",
 		success : function(data) {
 			var proList = data.product;
 			$("#numOfPro").text(proList.length);
 			var sumPrice = 0;
 			var html = "";
 			$.each(proList,function(idx,item){
 				var price = item.phyprice.split("*");
 				sumPrice += price[0]*price[1];
 				html += '<li><img width="50px" height="45px" src="<c:url value="/'+item.pphoto+'"/> " /><a href="<c:url value="/wlc/gpro?pcode='+item.pcode+'"/>">'+item.pname+'</a> <span class="price">'+item.phyprice+'</span></li>';
 			});
 			
 			$("#cartProList").html(html);
 			if(html == ""){
 				$("div.cart_drop ul:eq(0)").css("display","none");
 				$("div.cart_drop ul:eq(1)").css("display","block");
 			}else{
 				$("div.cart_drop ul:eq(1)").css("display","none");
 				$("div.cart_drop ul:eq(0)").css("display","block");
 			}
 			$("#sumprice").text("￥"+sumPrice);
 		}
 	});
} 
//-->
</script>  
<div class="header_container">
        <!--Header Starts-->
        <header><div class="header">
            <div class="top_bar clear">
                <!--Language Switcher Starts-->
                <div class="language_switch"> Hi. 蜗牛2. </div>
				<div class="language_switch head-right"> 您好,&nbsp;
					<c:if test="${user != null }">${uname} &nbsp; [<a href="<c:url value="/urc/center"/>">用户中心</a>]&nbsp;|&nbsp;[<a href="<c:url value="/urc/lgnout"/>">退出</a>]</c:if>
					<c:if test="${user == null }"> 欢迎蜗牛商城 ! &nbsp;[<a href="<c:url value="/urc/lgnpage"/>">登录</a>]&nbsp; [<a href="<c:url value="/urc/regpage"/>">免费注册</a>]
					</c:if>
					 &nbsp;|&nbsp; <a class="nav" href="<c:url value="/ordc/myorder"/>">我的订单</a>&nbsp;|&nbsp;<a class="nav" href="#">客户服务</a></div>
                <!--Top Links Ends-->
            </div>
            <!--Logo Starts-->
            <h1 class="logo"> <a href="<c:url value="/wlc"/>"><img src="<c:url value="/images/logo_01.jpg"/> " /></a> </h1>
            <!--Logo Ends-->
            <!--Search Starts-->
            <form class="header_search" action="">
                <div class="form-search">
                    <input id="search" type="text" name="q" value="" class="input-text" autocomplete="off" placeholder="Search" />
                    <button type="submit" title="Search"></button>
                </div>
            </form>
            <!--Search Ends-->
        </div></header>
        <!--Header Ends-->
    </div>
    <div class="navigation_container">
        <!--Navigation Starts-->
        <nav><div class="nav">
            <ul class="primary_nav">
                <li class="active"><a href="javascript:">全部商品分类</a>
                    <!--SUbmenu Starts-->
                    <ul class="sub_menu">
                        <li class="sub_menu_li"> <div><a href="#">电子,数码类</a></div>
                            <ul class="sub_menu_li_ul">
                                <li><a href="#">鼠标</a></li>
                                <li><a href="#">键盘</a></li>
                                <li><a href="#">U盘</a></li>
                                <li><a href="#">数据线</a></li>
                                <li><a href="#">散热器</a></li>
                                <li><a href="#">音响</a></li>
                            </ul></li>
                            <li class="sub_menu_li">
                            <div><a href="#">电子,数码类</a></div>
                            <ul class="sub_menu_li_ul">
                                <li><a href="#">鼠标</a></li>
                                <li><a href="#">键盘</a></li>
                                <li><a href="#">U盘</a></li>
                                <li><a href="#">数据线</a></li>
                                <li><a href="#">散热器</a></li>
                                <li><a href="#">鼠标垫</a></li>
                                <li><a href="#">鼠标垫</a></li>
                            </ul></li>
                            <!-- 生活服务 这个模块 静态 -->
                            <li class="sub_menu_li">
                            <div><a href="#">生活服务</a></div>
                            <ul class="sub_menu_li_ul">
                                <li><a href="<c:url value="/wlc/glstdl?dlcode=101&t=**&url=wlc"/> ">水果</a></li>
                                <li><a href="#">鲜花</a></li>
                                <li><a href="#">蛋糕</a></li>
                            </ul>
	                        </li>
                    </ul>
                    <!--SUbmenu Ends-->
                </li>
                <li><a href="<c:url value="/wlc"/> ">首页</a></li>
                <li><a href="<c:url value="/wlc/glstdl?dlcode=10101&t=..***.."/> ">水果</a></li>
                <li><a href="<c:url value="/wlc/server"/> ">贴心服务</a></li>
                <%-- <li><a href="<c:url value="/wlc/hotel"/> ">旅馆预订</a></li> --%>
                <%-- <li><a href="<c:url value="/wlc/fruit"/> ">实体店展</a></li> --%>
            </ul>
            <!-- onclick="loadShopCart()" -->
            <div class="minicart"><a href="<c:url value="/crtc/cart"/>"  class="minicart_link">购物车 &nbsp;  <span class="item"><b id="numOfPro">0</b> 件 </span></a>
                <div class="cart_drop"> <span class="darw"></span>
                    <ul>
                        <div id="cartProList"></div>
                        <div class="cart_bottom">
                            <div class="subtotal_menu"><small>总计:</small>
                           			 <big id="sumprice">￥0.00</big>
                            </div>
                            <a href="<c:url value="/crtc/cart"/>">购买</a></div>
                    </ul>
                    <ul>
                       <div class="nogoods">
                             <b class="noshopcart_class"></b>
                                                                                        购物车为空,赶紧购物
                       </div>
                    </ul>
                </div>
            </div><div class="cle"></div>
        </div></nav>
        <!--Navigation Ends-->
    </div>

